package model;

/**
 * Team EBE - Elite Bombard Elephants
 * 
 * AttributeImpl.java extends ClassElement and adds the toString functionality
 * 
 */
public class AttributeImpl extends ClassElement {

	/**
	 * AttributeImpl creates the attribute string that contains the attribute
	 * elements
	 */
	public AttributeImpl() {
		super();
	}

	/**
	 * AttributeImpl creates the attribute string that contains the attribute
	 * elements
	 * 
	 * @param nameIn
	 *            the name of the attribute
	 * @param typeIn
	 *            the type of the attribute
	 * @param visIn
	 *            the visibility of the attribute
	 */
	public AttributeImpl(String nameIn, String typeIn, char visIn) {
		super(nameIn, typeIn, visIn);
	}

	/**
	 * toString returns the string consisting of the visibility implementation
	 * in the attribute section of the class inspector
	 */
	public String toString() {
		return visibility + " " + this.getName() + " : " + this.getType();
	}

	/**
	 * saveString saves the string of the attribute elements
	 * 
	 * @return s the overall string and elements defining the attribute
	 */
	public String saveString() {

		String s = "<attribute>\n<visibility>" + this.getVisibility()
				+ "</visibility>\n<eName>" + this.getName()
				+ "</eName>\n<eType>" + this.getType()
				+ "</eType>\n</attribute>\n";
		return s;

	}

}